﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace CurrentCostGUI
{
    internal class GuiConfig
    {
        static string  userGuidKey = "userGuid";

        public static string GetUserGuid()
        {
            string value = ConfigurationManager.AppSettings[userGuidKey];
            return value;
        }

        public static void SaveUserGuid(string newUserGuid)
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            config.AppSettings.Settings[userGuidKey].Value = newUserGuid;
            config.Save(ConfigurationSaveMode.Full);
            ConfigurationManager.RefreshSection("appSettings");  
        }
    }
}
